<?php

//use Illuminate\Support\Facades\Schema;
use Jialeo\LaravelSchemaExtend\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateProductsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('products', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('category_id')->default(0)->comment('分类ID')->index();
            $table->string('title')->default('')->comment('标题');
//            $table->string('description')->default('')->comment('描述');
            $table->string('image')->default('')->comment('封面');
            $table->string('url')->default('')->comment('首页展示图片');
            $table->unsignedTinyInteger('is_suggest')->default(0)->comment('首页推荐，0=不推荐，1=推荐');
            $table->unsignedInteger('is_release')->default(0)->comment('是否发布，0=不发布，1=发布');
            $table->unsignedInteger('is_home')->default(0)->comment('是否首页轮播展示，0=不展示，1=展示');
            $table->unsignedInteger('pv')->default(0)->comment('访问次数');
            $table->string('seo_title')->default('')->comment('SEO标题');
            $table->string('seo_description')->default('')->comment('SEO描述');
            $table->string('seo_keyword')->default('')->comment('SEO关键字');
            $table->string('comment')->default('')->comment('备注');
            $table->timestamps();
            $table->softDeletes();
            $table->comment = '产品表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('products');
    }
}
